• Image placeholder
  • 홈 페이지
  • 블로그 센터
  • 범주
Image placeholder

Up casting

[Java] 객체지향 프로그래밍 - 다형성

객체지향 개념에서 다형성이란 여러가지 형태를 가질 수 있는 능력을 의미하며, 자바에서는 한 타입의 참조 변수로 여러 타입의 객체를 참조할 수 있도록 하여 다형성을 프로그래밍적으로 구현했어요. 위 예제처럼 Person과 NoobNoob이 상속 관계에 있으면 부모 클래스 타입의 변수에 자식 클래스 인스턴스를 참조할 수 있게 해요. 그래서 자식 타입의 참조 변수로 부모 타입의 인스턴스를 참조하는 ...

Up castingDown CastingObject Oriented ProgrammingPolymorphisminstanceofOOPJavaDown Casting

© 2022 intrepidgeeks.com

Privacy Policy Contact US Sitemap
🍪 This website uses cookies to ensure you get the best experience on our website. Learn more